Repository navigation
Let a freshly crafted mage weapon take a charge before restart - #59
Conversation
The station cache held the weapon object that was just built, while expected() compares it with the copy read back from gear-stations.yml. Paper writes a freshly built item's components in another order than its re-read copy, so the byte check failed: every charge said "already mid-attunement" and shift-left-click refunded nothing until the next restart reloaded the cache from disk. install() and update() now cache the re-read copy, as a restart does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
A mage weapon crafted at a gear station could not take a charge or be taken apart until the server restarted. Every charge said "This station is already mid-attunement", and shift-left-click refunded nothing. Each attempt logged
[Magic] Gear property held: Occupancy authority or item changed. Reported on Main on 2026-10-17 (Vaultinfinite's craft at 3784,172,1693).Cause:
GearStationStore.expected()compares the cached weapon's bytes with the copy read back fromgear-stations.yml. On a deposit, the cache held the item object that had just been built. Paper serializes a freshly built item's components in a different order than its re-read copy. On Main the stored and re-serialized bytes were the same length, withminecraft:tooltip_displayandminecraft:custom_nameswapped. So the check failed until a restart reloaded the cache from disk.Fix:
install()(deposit) andupdate()(end of an orb run) now cache the item decoded from the bytes they just wrote, as a restart does.install()no longer takes the item argument, since it reads it from the row.Tests:
GearStationRereadBytesTest: re-read copies serialize differently in the fixture codec. It fails onmainwith the production error and passes here.mvn clean verifyon Linux: 644 tests, 0 failures, coverage gate met. (The gear file tests cannot run on Windows because of directory fsync.)tfmc:magic_crafting_station:heldlogged.heldlines.🤖 Generated with Claude Code